/*
 * Author: 李波(Edwin Lee)
 * Date: 2024-06-21 22:40:01
 * FilePath: /chat/include/server/groupmodel.h
 * LastEditTime: 2024-06-21 23:40:27
 * version: 1.0
 * Description: 
 */
#ifndef GROUPMODEL_H
#define GROUPMODEL_H

#include "group.hpp"
#include <string>
#include <vector>
using namespace std;

// 维护群组信息的操作接口方法
class GroupModel
{
public:
    //description: 创建群组,写入allgroup表
    //param group:
    //return {void}
    //Date: 2024-06-21 22:45:52
    bool createGroup(Group& group);

    //description: 加入群组，写入groupuser表
    //param userid:
    //param groupid:
    //param role:
    //return {void}
    //Date: 2024-06-21 22:47:24
    void addGroup(int userid, int groupid, string role);

    //description: 查询用户所在群组信息,allgroup和groupuser联表查询
    //param userid:
    //return {void}
    //Date: 2024-06-21 22:49:47
    vector<Group> queryGroups(int userid);

    //description: 根据指定的groupid查询群组用户id列表，除userid自己，主要用户群聊业务给群组其他成员群发信息
    //param userid:
    //param groupid:
    //return {void}
    //Date: 2024-06-21 22:52:20
    vector<int> queryGroupUsers(int userid, int groupid);
};
#endif